Ravi Vishwakarma is a dedicated Software Developer with a passion for crafting efficient and innovative solutions. With a keen eye for detail and years of experience, he excels in developing robust software systems that meet client needs. His expertise spans across multiple programming languages and technologies, making him a valuable asset in any software development project.
ICSM Computer
05-May-2025To read and write to a file simultaneously using
FileStream, you can open the file with:FileAccess.ReadWrite(allows both reading and writing)FileModelikeOpenorOpenOrCreateExample: Read and write to the same file
Notes:
Use
fs.Seek(0, SeekOrigin.Begin)to reposition the stream before reading.This works for simple scenarios. For concurrent read/write from different threads, you'd need more advanced synchronization.